<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

</body>
<script type="module">
    import { ajaxPromise } from "../js/ajax.js"
    console.log(ajaxPromise);


    /* ajaxPromise({
        type: "get",
        url: "/grade",  // 根路径紧接域名之后 等价于: http://localhost:3000/grade  
        dataType: "json"
    }).then(res => {
        console.log("请求成功", res);
    }).catch(err => {
        console.log("请求失败", err);
    })
 */
    ajaxPromise({
        type: "get",
        url: "/grade/searchGradeById",  // 根路径紧接域名之后 等价于: http://localhost:3000/grade  
        data: { id: 1 },
        dataType: "json"
    }).then(res => {
        console.log("请求成功", res);
    }).catch(err => {
        console.log("请求失败", err);
    })
</script>

</html>